package com.wanlian.router.bean;

import java.util.Locale;

/**
 * Created by Hyu on 2018/9/27.
 * Email: fvaryu@163.com
 */
public class ShareDisk extends Base {


    /**
     * id : 1
     * photo : 0.0
     * movie : 0.0
     * music : 0.0
     * other : 0.0
     * total : 102400.0
     * userId : 22
     * modifyTime : 1537364084000
     * remark :
     * enable : true
     */

    private int id;
    private double photo;
    private double movie;
    private double music;
    private double other;
    private double total;
    private int userId;
    private long modifyTime;
    private String remark;
    private boolean enable;

    private double sum; //": 32766.4,
    private int share; //": 0

    public double getSum() {
        return sum;
    }

    public void setSum(double sum) {
        this.sum = sum;
    }

    public int getShare() {
        return share;
    }

    public void setShare(int share) {
        this.share = share;
    }

    private String format(double size) {
        int a = (int) size;
        if (a >= 1024) {
            return String.format(Locale.getDefault(), "%.2fG", size / 1024);
        }
        return String.format(Locale.getDefault(), "%.2fM", size);
    }

    public String getUIFree() {
        return format(other);
    }


    public String getUIPhoto() {
        return format(photo);
    }


    public String getUIMusic() {
        return format(music);
    }


    public String getUIMovie() {
        return format(movie);
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getPhoto() {
        return photo;
    }

    public void setPhoto(double photo) {
        this.photo = photo;
    }

    public double getMovie() {
        return movie;
    }

    public void setMovie(double movie) {
        this.movie = movie;
    }

    public double getMusic() {
        return music;
    }

    public void setMusic(double music) {
        this.music = music;
    }

    public double getOther() {
        return other;
    }

    public void setOther(double other) {
        this.other = other;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public long getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(long modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }
}
